namespace Resharper.Abstractions.CodeAnnotations
{
  using JetBrains.ReSharper.Psi.CSharp.Tree;
  using JetBrains.ReSharper.Psi.Tree;
  using Resharper.Abstractions.Daemons;

  /// <summary>Defines the <see cref="CodeAnnotationDaemonBase"/> class.</summary>
  public abstract class CodeAnnotationDaemonBase : DaemonBase
  {
    #region Methods

    /// <summary>Processes the tree node.</summary>
    /// <param name="treeNode">The tree node.</param>
    protected override void ProcessTreeNode(ITreeNode treeNode)
    {
      try
      {
        if (treeNode is IMethodDeclaration)
        {
          base.ProcessTreeNode(treeNode);
          return;
        }

        if (treeNode is IPropertyDeclaration)
        {
          base.ProcessTreeNode(treeNode);
          return;
        }

        if (treeNode is IConstructorDeclaration)
        {
          base.ProcessTreeNode(treeNode);
          return;
        }

        if (treeNode is IIndexerDeclaration)
        {
          base.ProcessTreeNode(treeNode);
        }
      }
      catch
      {
        return;
      }
    }

    #endregion
  }
}